projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e3c026
)
RX 8025 RTC: analyze 12/24-hour mode flag in rtc_get().
author
Yuri Tikhonov
<
[email protected]
>
Fri, 15 Aug 2008 13:42:09 +0000
(15:42 +0200)
committer
Wolfgang Denk
<
[email protected]
>
Fri, 5 Sep 2008 23:22:20 +0000
(
01:22
+0200)
Signed-off-by: Yuri Tikhonov <
[email protected]
>
drivers/rtc/rx8025.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rx8025.c
b/drivers/rtc/rx8025.c
index 064138e9eb6edd0b51de0b762214686a2e8a6ef8..fd6aec5feb0bb5d18c745919cc382f465891f032 100644
(file)
--- a/
drivers/rtc/rx8025.c
+++ b/
drivers/rtc/rx8025.c
@@
-136,7
+136,11
@@
int rtc_get (struct rtc_time *tmp)
tmp->tm_sec = bcd2bin (sec & 0x7F);
tmp->tm_min = bcd2bin (min & 0x7F);
- tmp->tm_hour = bcd2bin (hour & 0x3F);
+ if (rtc_read(RTC_CTL1_REG_ADDR) & RTC_CTL1_BIT_2412)
+ tmp->tm_hour = bcd2bin (hour & 0x3F);
+ else
+ tmp->tm_hour = bcd2bin (hour & 0x1F) % 12 +
+ ((hour & 0x20) ? 12 : 0);
tmp->tm_mday = bcd2bin (mday & 0x3F);
tmp->tm_mon = bcd2bin (mon & 0x1F);
tmp->tm_year = bcd2bin (year) + ( bcd2bin (year) >= 70 ? 1900 : 2000);